package com.hushao.lims.weblims.repository;

import com.hushao.lims.weblims.domain.ConsumableApply;
import com.hushao.lims.weblims.domain.ConsumableInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author 930588706
 * @date 18/1/24
 */
public interface ConsumableApplyRepository extends JpaRepository<ConsumableApply,Long> {
    /**
     * 根据耗材名称，状态，模糊查询耗材申请表（分页）
     * @param consumableName
     * @param state
     * @param pageable
     * @return
     */
    Page<ConsumableApply> findByConsumableInfo_ConsumableNameLikeAndApplyConsumableStateLike(String consumableName, String state, Pageable pageable);

    /**
     *  根据耗材，数量，状态，查询申请耗材信息
     * @param consumableInfo
     * @param consumableCount
     * @param state
     * @return
     */
    List<ConsumableApply> findByConsumableInfoAndConsumableCountAndApplyConsumableState(ConsumableInfo consumableInfo, Integer consumableCount, String state);
}
